package com.xja.git.utils;

/**
 * @CreateTime
 * @Author:樊浩杰
 * @Description:
 */
public class PageResult {
    private  Integer code;
    private String msg;
    private Object object;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public PageResult(Integer code, String msg, Object object) {
        this.code = code;
        this.msg = msg;
        this.object = object;
    }

    public PageResult() {
    }

/**
     * 此方法是状态码成功的方法
     * */
    public  static PageResult success(String msg, Object object){
        return new PageResult(200,msg,object);
    }

    /**
     * 此方法是状态码为100的方法
     * */
    public  static PageResult none(String msg){
        return new PageResult(100,msg,null);
    }

    /**
     * 此方法是状态码为500的方法(错误)
     * */
    public  static PageResult error(String msg){
        return new PageResult(500,msg,null);
    }
}
